import type {FormRules} from 'naive-ui'

/**
 * 用户信息表单验证规则
 */
export const UserFormRules: FormRules = {
  username: {
    required: true,
    message: '请输入用户名',
    trigger: 'blur'
  },
  nickname: {
    required: true,
    message: '请输入昵称',
    trigger: 'blur'
  },
  password: {
    required: true,
    message: '请输入密码',
    trigger: 'blur',
    min: 6,
    max: 20
  },
  email: {
    required: true,
    message: '请输入邮箱',
    trigger: 'blur',
    pattern: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
  },
  phone: {
    required: true,
    message: '请输入手机号',
    trigger: 'blur',
    pattern: /^1[3456789]\d{9}$/
  }
} 